package mk.com.ldm.corepoint.implementation.client.event;

import com.google.gwt.event.shared.GwtEvent;

public class NavigationEvent extends GwtEvent<NavigationEventHandler> {
	public static Type<NavigationEventHandler> TYPE = new Type<NavigationEventHandler>();
	String type;
	String id;
	String itemId;
	String name;

	public NavigationEvent(String type, String id, String name) {
		this.type = type;
		this.id = id;
		this.name = name;
	}

	public NavigationEvent(String type, String id, String name, String itemId) {
		this.type = type;
		this.id = id;
		this.itemId = itemId;
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public String getItemId() {
		return itemId;
	}

	public String getType() {
		return type;
	}

	public String getId() {
		return id;
	}

	@Override
	public Type<NavigationEventHandler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(NavigationEventHandler handler) {
		handler.onNavigate(this);
	}
}
